package org.sws.domain.activity.service.quota.policy.impl;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.sws.domain.activity.model.aggregate.CreateQuotaOrderAggregate;
import org.sws.domain.activity.model.valobj.OrderStateVO;
import org.sws.domain.activity.repository.IActivityRepository;
import org.sws.domain.activity.service.quota.policy.ITradePolicy;

/**
 * @Author sws
 * @Date 2025/4/2 15:53
 * @description: 积分兑换方式
 */
@Service("credit_pay_trade")
@RequiredArgsConstructor
public class CreditPayTradePolicy implements ITradePolicy {
    private final IActivityRepository activityRepository;
    @Override
    public void trade(CreateQuotaOrderAggregate createQuotaOrderAggregate) {
        createQuotaOrderAggregate.setOrderState(OrderStateVO.wait_pay);
        activityRepository.doSaveCreditPayOrder(createQuotaOrderAggregate);
    }
}
